<template>
    <div class="client">
        <div class="title">
            <img class="back" src="../assets/Fill 1@2.88x.png" alt="" @click="backs">
            {{navtitle}}
        </div>
        <div class="content">
            <div class="kong"></div>
            <div class="con-up" v-for="(item,index) in goods" :key="index">
                <p class="up-left">{{item.tagName}}</p>
                <span class="up-right" @click="getClientsou()">{{item.count}}</span>
            </div>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    name:'client',
    data(){
        return{
            navtitle:'客户管理',
            goods:''
        }
    },
    methods:{
        backs(){
            this.$router.back(-1)
        },
        getClientsou(){
                this.$router.replace('/clientsou')
        },
        
        getAxios(){
            axios.post('https://web-gateway.newbeescm.com/ms-web/memberController/selectShopTagAndCount?shopId=6694',{
                shopId:6694,
                headers:{
                    token: this.$store.state.token,
                    userId: this.$store.state.userInfo.id
                },
            },{}).then(res=>{
                console.log(res);
                if (res.data.status.statusCode === 0) {
                    this.goods = res.data.result;
                }
            }).catch(err=>{
                console.log(err)
            })
        }
    },
    created(){
        this.$nextTick(()=>{
            this.getAxios()
        })
    }
}
</script>

<style lang="scss" scoped>
.client{
    width: 100%;
    height: 100%;
    .title{
        height: 0.435rem;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #030303;
        font-size: 0.18rem;
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        background: #fff;
        z-index: 999;
        .back{
            position: absolute;
            left:0.14rem;
            bottom: 0.1rem; 
            width: 0.1rem;
            height: 0.18rem;
        }
        &::after{
            content: "";
            position: absolute;
            width: 100%;
            left: 0;
            bottom: 0;
            background: #ccc;
            height: 1px;
            transform:scale(1,0.5) 
        }
    }
    .content{
        width: 100%;
        height: 6.22rem;
        background: #ddd;
        .kong{
            width: 100%;
            height: 0.15rem;
        }
        .con-up{
            width: 100%;
            height: 0.44rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 0.14rem;
            background: #fff;
            box-sizing: border-box;
            position: relative;
            border-bottom: 1px solid #eee;
            .up-left{
                font-size: 0.12rem;
                color: #333;
            }
            .up-right{
                font-size: 0.12rem;
                color: #DD3333;
            }
        }
    }
}
</style>
